Map. put ("Beijing", "101010100 ");Map. put ("Shanghai", "101020100 ");Map. put ("Tianjin", "101030100 ");Map. put ("Chongqing", "101040100 ");// HeilongjiangMap. put ("", "101050101 ");Map. put ("Qiqihar", "101050201 ");Map. put ("Peony", "101050301
Package test;
Import java. util. collections;Import java. util .*;
Public class testlist {Public static void main (string [] ARGs ){Map map = new hashmap ();Map. Put ("1", "hello ");Map. Put ("2", "world ");Map. Put ("3", "nihao ");Map. Put ("4",
Android development step-by-step 35: usage of GridView
When I used asp.net to develop software, I also used the GridView. I found that there is also such a control in android. The usage is a bit similar. I used an adapter to bind data to this
Map is a data storage method. In my personal opinion, it is an array in php or asp.net and can be directly used for Traversing arrays. However, there are many inherent methods for Traversing map in java, let's take a look at some instances.
The
In android development, ListView is a commonly used component that displays specific content in the form of a list and can be automatically displayed based on the length of data.
The display of the list requires three elements:
1. ListVeiw is used
Public class ListViewActivity extends ListActivity{/** Called when the activity is first created .*/@ OverridePublic void onCreate (Bundle savedInstanceState){Super. onCreate (savedInstanceState );// SetContentView (R. layout. main ); SimpleAdapter
Usage of various adapters in Android
1. Concept
Adapter is an Adapter interface connecting back-end data and front-end display. It is an important link between data and UI (View. Adapter is required in common View (ListView, GridView) and other
/*In HashMap, how to sort by value first and then by keyExample: Map result = new HashMap ();Sort by numbers and then by letters. Place the key-value in HashMap to TreeMap.And then sort the rows? It is best to give an example.*//*TreeMap does not
Based on the json-lib.jar package JSON program, this article mainly introduces a simple example!1. First, JSON-lib must support at least the following JAR packagesJakarta commons-lang 2.4Jakarta commons-beanutils 1.7.0Jakarta commons-collections
Create an Excel file and insert a value in javaPublic class test {/*** Exported CVS file* @ Param exportData the data set to be imported into Excel* @ Param rowMapper Excel Header* @ Param outputPath: location where the Excel file is saved* @ Return
It seems that map inherits from Collection like other Collection classes. In fact, Map and Collection do not have any relationship at the structural level, by viewing the source code, we can find that all map operations are based on key-value pairs,
The following exception occurs in poi Excel operations: org. Apache. Poi. openxml4j. Exceptions. invalidformatexception: Package shoshould contain a content type part code: Public Boolean parsetoexcel (string oldfilename, string newfilename ){
Map
An exception occurred in POI Excel. org. apache. poi. openxml4j. exceptions. invalidformatexception: package shoshould contain a c, excelcontainThe following exception occurs in POI Excel operations: org. apache. poi. openxml4j. exceptions.
Java Collection knowledge point summary-blog Park: Holding, holding, java knowledge point
Differences between arrays and collections:
Arrays in Java are collections that store the same type of data. An array can store basic data or referenced data,
JAVA learning lesson 38th (Common Object API)-set framework (6)-Map set and common methods
1. Map set features
The Map set (double row set) adds one element at a time, and the Collection set (single column set) adds one element at a time.Interface
Android note 11. ListView + AdapterUnderstanding Adapter 1. ListViewListView is a common component in Android development. It displays data in the form of a list. Generally, a ListView consists of the following three elements:1. View: Displays the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.